package com.example.springstudy.dao.res;

import com.example.springstudy.dao.dto.EmployeeDto;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.util.List;

@Data
@NoArgsConstructor
public class EmployeeListRes {
    private int total;
    private List<EmployeeDto> list;
    private int currentPage;
    private int totalPage;

    public EmployeeListRes(List<EmployeeDto> list, int page, int size, int total) {
        this.total = total;
        this.list = list;
        this.currentPage = page;
        this.totalPage = (int) (total/size) + (total % size == 0 ? 0 : 1);
    }
}
